/*
 *  Copright: 2008 Philipp Leitner, Distributed Systems Group,
 *            TU Wien, leitner@infosys.tuwien.ac.at
 *
 *  This file is part of DAIOS.
 *
 *  DAIOS is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU Lesser General Public License as
 *  published by the Free Software Foundation.
 * 
 *  DAIOS is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU Lesser General Public License for more details.
 *
 *  You should have received a copy of the GNU Lesser General Public
 *  License along with DAIOS.  If not, see
 *  <http://www.gnu.org/licenses/>.
 * 
 */

package at.ac.tuwien.infosys.dsg.daios.wsdl.impl;

import java.util.List;

import at.ac.tuwien.infosys.dsg.daios.wsdl.interfaces.IWSDLMessage;
import at.ac.tuwien.infosys.dsg.daios.wsdl.interfaces.IWSDLPart;

/**
 * A Daios WSDL message.
 * 
 * @author philipp
 *
 */
public class WSDLMessage implements IWSDLMessage {
	
	private String namespace = null;
	private String name = null;
	private List<IWSDLPart> parts = null;
	
	/**
	 * Construct a new WSDL Message.
	 * 
	 * @param namespace The namespace of the new message.
	 * @param name The name of the new message.
	 * @param parts A list of all parts that should be contained
	 * in this message.
	 */
	public WSDLMessage(String namespace, String name, List<IWSDLPart> parts) {
		this.namespace = namespace;
		this.name = name;
		this.parts = parts;
	}
	
	/**
	 * Get the name of this message.
	 * 
	 * @return The message name.
	 */	
	public String getMessageName() {
		return name;
	}

	/**
	 * Get the namespace of this message.
	 * 
	 * @return The message namespace.
	 */	
	public String getMessageNamespace() {
		return namespace;
	}

	/**
	 * Get a list of all parts defined in
	 * this message.
	 * 
	 * @return A list of all named message parts.
	 */	
	public List<IWSDLPart> getParts() {
		return parts;
	}
	
	/**
	 * Print this message.
	 * 
	 */
	public String toString() {
		return getMessageName();
	}

}
